package mysql

import (
	"fmt"
	"github.com/jmoiron/sqlx"
)

func update(db *sqlx.DB) error {
	res, err := db.Exec("update person set username=? where user_id=?", "stu0003", 2)
	if err != nil {
		fmt.Println("exec failed, ", err)
		return err
	}
	row, err := res.RowsAffected()
	if err != nil {
		fmt.Println("rows failed, ",err)
		return err
	}
	fmt.Println("update succ:",row)
	return nil
}
